﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ResxLocalizationEditor {
    abstract class ResourceWriter {

        public void Load(Resource resource, string filePath) {
            resource.OriginalResourcePath = filePath;

            LoadCore(resource, filePath);
        }

        protected abstract void LoadCore(Resource resouce, string filePath);

        public void Write(ResourceSet set, Resource resource, string basePath) {
            var filePath = ResourceHelper.AppendLanguageToBaseFilename(basePath, resource.Language.Name);
            
            WriteCore(set, resource, filePath);
        }

        protected abstract void WriteCore(ResourceSet set, Resource resource, string filePath);

    }
}
